<script type="text/javascript" src="../../../../../Scripts/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="../../../../../Scripts/JQPrint/jquery.jqprint-0.3.js"></script>
<script src="../../../../../Scripts/JQPrint/jquery-migrate-1.2.1.min.js"></script>

<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: -20px 30px 0 0;">
    <blockquote class="layui-elem-quote">
        <input type="button" value="打印" class="layui-btn" onclick="Print()">
        <input type="button" value="返回" class="layui-btn" onclick="Return2()">
        <span style="color:green;margin-left:20px;"><!--说明：在打印设置中,去除“页脚和页眉”选项，可不显示页脚和页眉的信息。--></span>
    </blockquote>
    <script type="text/javascript">
        function Print() {
            document.getElementById("area1").style.visibility = "hidden";//隐藏
            $("#setFormLayout").jqprint();
            layer.close(printIndex);
        }
        function Return2() {
            layer.close(printIndex);
        }
    </script>
    <div style="border:0.8px #e9e9e9 solid;border-radius:8px;width:474px;height:308px;margin-left:100px;margin-top:50px;">
        <div id="setFormLayout" style="width:474px;height:258px;">
            <style>
                .div1 {
                    margin-top: 2%;
                    margin-left: 5%;
                }

                .sp1 {
                    font-weight: bold;
                    font-size: 1.0em;
                    /*font-family:FangSong;*/
                }

                .sp2 {
                    font-weight: bold;
                    font-size: 1.0em;
                }

                .sp3 {
                    font-weight: bold;
                    font-size: 0.7em;
                    margin-top: 2px;
                }

                .sp4 {
                    font-size: 0.9em;
                    color: black;
                    font-weight:500;
                }

                .QrCodeImg {
                    width: 86%;
                    margin: 10px;
                }

                .div2 {
                    margin-top: -65px;
                }

                .div3 {
                    float: left;
                    margin-top: -90px;
                    margin-left: -15px;
                }

                .div4 {
                    float: left;
                    width: 100%;
                    text-align: center;
                    margin: 20px 0 0 -15px;
                }
            </style>

            <div class="div1">
                <div id="area1" style="position:relative;">
                    <span class="sp1">优惠券名称：明光市城市管理新政执法局 &nbsp;&nbsp;&nbsp;&nbsp; 联系电话：0550-8092212</span>
                    <div style="margin-top:68px;">
                        <div style="width:30%;float:left">
                            <span class="sp1">微信二维码</span>
                        </div>
                        <div style="width:70%;float:left">
                            <span class="sp2">&nbsp;&nbsp;&nbsp; 优惠券描述：</span>
                            <p class="sp3"><span id="desc"></span></p>

                        </div>
                    </div>
                </div>
                <!-- <div class="div2">
                    <table style="margin-left:0px;">
                        <tr style="height:32px;">
                            <td style="width:50%"><span class="sp4">养犬人姓名：<span id="pname"></span></span></td>
                            <td><span class="sp4">登记证号：<span id="pcode" style="font-size:1.1em;"></span></span></td>
                        </tr>
                        <tr>
                            <td style="width:50%"><span class="sp4">犬种名：<span id="ptype"></span></span></td>
                            <td><span class="sp4">所属区县：<span id="parea">明光市</span></span></td>
                        </tr>
                    </table>
                </div> -->
                <div class="div3">
                    <img id="pimg" src="" alt="" width="110" />
                </div>
                <div class="div4">
                    <span class="sp4">日期：<span id="pdate" style="font-size:1.2em;"></span></span>
                </div>
            </div>

        </div>

    </div>

    <script type='text/html' template lay-done='layui.data.formdones();'>
    </script>

</div>

<script type="text/javascript">

    var form, admin, $, upload;
    layui.use(['form','admin','laydate','upload'], function () {
        form = layui.form;//required（必填项）phone（手机号）email（邮箱）url（网址）number（数字）date（日期）identity（身份证） 自定义值
         
    });

    layui.data.formdones = function () {
        layui.use(['admin', 'form'], function () {
            $ = layui.$;
            form = layui.form;
            admin = layui.admin;

            $("#pname").text(PrintData.PersonName);
            $("#pcode").text(PrintData.Number);
            $("#ptype").text(PrintData.dogbrand);
            //$("#parea").text();  //区县
            $("#pimg").attr("src", PrintData.PersonCode);
            var date = getNowFormatDate();
            $("#pdate").text(date);
        });
    }

    function getNowFormatDate() {
        var date = new Date();
        var year = date.getFullYear();
        var month = date.getMonth() + 1;
        var strDate = date.getDate();
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9) {
            strDate = "0" + strDate;
        }
        var currentdate = year + "年" + month + "月" + strDate + "日";
        return currentdate;
    }

</script>
